<include file="Public/HOME/HTML/head_html_5.html"/>
<meta charset="utf-8"/>
<title>我的项目{$Think.const.TITLE}</title>
<include file="Public/HOME/HTML/CssAndJs.html"/>
<include file="Public/HOME/HTML/middle_list.html"/>
<include file="Public/HOME/HTML/ProjectManagement.html"/>
<!-- DataTables Example -->
<script>

    function projectDel(xid) {
        var gradename = xid;
        address = "{$Think.const.DOMAIN_NAME}Home/Project/projectDel/id/" + gradename; // 设置$.get调用路径
        var delTr = document.getElementById(xid);                                  // 获取动态的表格ID
        $.get(address, function (str) {                                               // 方法不太明白，大概意思是获取$.get返回的值
            if (str == 0) {                                                            // 如果返回的时0的话就证明是对的
                ZENG.msgbox.show("删除成功！", 4, 1000);
                delTr.parentNode.removeChild(delTr);                                   // 删除该行
            } else {                                                                     // 其他情况都是原密码错误
                ZENG.msgbox.show("删除失败！", 5, 2000);
            }
        });
    }
    function change(id, dd) {
        name = document.getElementById(dd).className;
        if (name == "label label-success") {
            address = "{$Think.const.DOMAIN_NAME}Home/Project/change/o/1/id/" + id;           // 设置$.get调用路径
            $.get(address, function (str) {
                if (str == 1) {
                    document.getElementById(dd).className = 'label label-warning';
                    document.getElementById(dd).innerHTML = '停止招标';
                }
            });

        }
        if (name == "label label-warning") {
            address = "{$Think.const.DOMAIN_NAME}Home/Project/change/o/2/id/" + id;           // 设置$.get调用路径
            $.get(address, function (str) {
                if (str == 1) {
                    document.getElementById(dd).className = 'label label-success';
                    document.getElementById(dd).innerHTML = '招标中';
                }
            });
        }
        if (name == "label label-warning") {
            address = "{$Think.const.DOMAIN_NAME}Home/Project/change/o/2/id/" + id;           // 设置$.get调用路径
            $.get(address, function (str) {
                if (str == 1) {
                    document.getElementById(dd).className = 'label label-success';
                    document.getElementById(dd).innerHTML = '招标中';
                }
            });
        }

    }
</script>
<script src="{$Think.const.ADMINJS}Hint.js" type="text/javascript">

</script>
<script language="JavaScript">

</script>
<div class="row" style="height: 80%">
    <div class="col-lg-10" style="float: right">
        <div class="widget-container fluid-height clearfix">
            <div class="heading">
                <i class="icon-table"></i>我发布的项目
            </div>
            <div class="widget-content padded clearfix">
                <table class="table table-bordered table-striped dataTable"
                       id="datatable-editable">
                    <thead>
                    <th style="width: 10%; text-align: center">编号</th>
                    <th style="width: 20%; text-align: center">项目名称</th>
                    <th style="width: 10%; text-align: center">当前状态</th>
                    <th style="width: 10%; text-align: center">是否招标</th>
                    <th style="width: 15%; text-align: center">添加时间</th>
                    <th style="width: 15%; text-align: center">附件</th>
                    <th style="width: 20%; text-align: center;">操作</th>
                    </thead>
                    <tbody>
                    <assign name="delId" value="100000"/>
                    <volist name="myrelease" id="vo">
                        <tr id="{$vo.id}">
                            <td style="text-align: center;">{$number++}</td>
                            <td><a
                                    href="{$Think.const.DOMAIN_NAME}Home/project/details/id/{$vo.id}"
                                    target="_bank">{$vo.name}</a></td>
                            <td style="text-align: center;">

                                <if condition="$vo.enddate neq null">
                                    <span class="label label-danger">该项目已结束</span>
                                    <else/>

                                    <if condition="$vo.ischecked eq '1'"> 审核通过</if>
                                    <if condition="$vo.ischecked eq '2'"> 审核未通过</if>
                                    <if condition="$vo.ischecked eq '0'"> 未审核</if>
                                </if>
                            </td>
                            <td style="text-align: center;">
                                <if condition="$vo.enddate neq null">
                                    <span class="label label-warning">停止招标</span>
                                    <else/>
                                    <if condition="$vo.isbid eq '1'">
                                        <a href="javascript:void(0);">
                                            <span id="{$delId}" class="label label-success"
                                                  onclick="javascript:change({$vo.id},{$delId})">招标中</span></a>
                                    </if>
                                    <if condition="$vo.isbid eq '2'">
                                        <a href="javascript:void(0);">
                                            <span id="{$delId}" class="label label-warning"
                                                  onclick="javascript:change({$vo.id},{$delId})">停止招标</span></a>
                                    </if>
                                    <if condition="$vo.isbid eq '0'">
                                        <a href="javascript:void(0);">
                                            <span id="{$delId}" class="label label-warning"
                                                  onclick="javascript:change({$vo.id},{$delId})">不招标</span></a>
                                    </if>
                                </if>
                            </td>
                            <td style="text-align: center;">{$vo.adddate}</td>
                            <td style="text-align: center;">
                                <a href="{$Think.const.RESOURCES}UPLOADS/attach/{$vo.attach}" target="_bank">{$vo.attach|substr=###,20,15}</a>
                            </td>
                            <td style="text-align: center;">
                                <a class="table-actions"
                                   href="{$Think.const.DOMAIN_NAME}Home/project/alterProject/id/{$vo.id}" title="编辑">
                                    <i class="icon-pencil"></i></a>&nbsp;
                                <a class="table-actions" href="javascript:void(0);" onclick="if(confirm('確定刪除么？')==0){
									                                                             return false;}
																						     else{
																							 	 javascript:projectDel({$vo.id})
																						     }" title="删除">
                                    <i class="icon-trash"></i></a>&nbsp;
                                <a class="table-actions"
                                   href="{$Think.const.DOMAIN_NAME}Home/project/applyList/id/{$vo.id}" title="查看报名人员">
                                    <i class="icon-book"></i></a>&nbsp;
                                <a class="table-actions" data-toggle="modal" href="#jiexiang{$vo.id}" title="结项">
                                    <i class="icon-stop"></i></a>
                                <a class="table-actions"
                                   href="{$Think.const.DOMAIN_NAME}Home/Project/export_successful_personnel_information_table/id/{$vo.id}"
                                   title="导出中标人员excel">
                                    <i class="icon-calendar"></i></a>&nbsp; </td>
                        </tr {$addId++}
                                {$delId++}>

                    </volist>
                    </tbody>
                </table>
                <volist name="myrelease" id="vo">
                    <form action="__SELF__/id/{$vo.id}" method="post" enctype="multipart/form-data">
                        <div class="modal fade" id="jiexiang{$vo.id}">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button aria-hidden="true" class="close" data-dismiss="modal"
                                                type="button">&times;</button>
                                        <h4 class="modal-title">结束项目</h4>
                                    </div>
                                    <div class="modal-body">
                                        <input type="hidden" name="haoqingzaitianshuinengyuwozhengfeng"
                                               value="qingfengzaishoushuinengyijiantulong">
                                        <h4>上传附件</h4>
                                        <h6><font color="red">警告：一旦项目结束将不能进行招标等操作</font></h6>
                                        <h6><font color="green">可以不上传附件</font></h6>
                                        <div class="fileupload fileupload-new" data-provides="fileupload"><input
                                                type="hidden">
                                            <div class="input-group">
                                                <div class="form-control">
                                                    <i class="icon-file fileupload-exists"></i><span
                                                        class="fileupload-preview"></span>
                                                </div>
                                                <div class="input-group-btn">
                                                    <a class="btn btn-default fileupload-exists"
                                                       data-dismiss="fileupload" href="#">取消</a><span
                                                        class="btn btn-default btn-file"><span class="fileupload-new">选择文件</span><span
                                                        class="fileupload-exists">重新选择</span><input type="file"
                                                                                                    name="attach"></span>
                                                </div>
                                            </div>
                                        </div><br/>
                                        <div class="form-group">
                                            <div class="col-md-12">
                                                <textarea class="form-control" type="text" name="explain" placeholder="项目成果说明"></textarea>
                                            </div>
                                        </div>
                                        <br/>
                                    </div>
                                    <div class="modal-footer">
                                        <button class="btn btn-primary" type="submit">确定
                                        </button>
                                        <button class="btn btn-default-outline" data-dismiss="modal"
                                                type="button">关闭
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </volist>
            </div>
        </div>
    </div>

</div>
</div>
</div>
</div>
<!-- end DataTables Example -->
</div>
</div>
<include file="Public/HOME/HTML/footer.html"/>
</body>
</html>